package com.bibrApp.difu.actvity.wait_delivery_mvp;

import android.content.Context;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bibrApp.difu.actvity.wallet_mvp.IWalletView;
import com.bibrApp.difu.api.RetrofitNet;
import com.bibrApp.difu.base.BaseObserver;
import com.bibrApp.difu.base.BasePresenter;
import com.bibrApp.difu.fragment.jieru_mvp.JiedaiManagerBean;
import com.bibrApp.difu.utils.EncryptUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

public class WaitDeliveryPresenter extends BasePresenter<IWaitDeliveryView> {
    public WaitDeliveryPresenter(Context context, IWaitDeliveryView iView) {
        super(context, iView);
    }


    public void getData(String tallaId) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("orderId", tallaId);
        RetrofitNet.getInstance()
                .getApi()
                .getTradeDetail(EncryptUtils.encryptNewType(map))
                .compose(getActivityLifecycleProvider().bindToLifecycle())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .unsubscribeOn(Schedulers.io())
                .subscribe(new BaseObserver<Object>(context) {

                    @Override
                    protected void onSuccess(Object value) {
                    }

                    @Override
                    protected void onFialure(int code, String msg) {
                        super.onFialure(code, msg);
                    }
                });
    }
}
